﻿using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace UCTT.NetFx
{
    internal static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            //Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form9());
            //Application.Run(new NetFx.BTComm.BluetoothForm());

            //CalcTest();
        }

        /// <summary>
        /// 纯计算性能测试
        /// </summary>
        static void CalcTest()
        {
            Stopwatch watch = new Stopwatch();
            watch.Start();

            Parallel.For(0, 10, i =>
            {
                var x = 0;
                for (int j = 0; j < 5000000; j++)
                {
                    x += 1;
                }
                Console.WriteLine("线程:{0} 完成计数", Thread.CurrentThread.ManagedThreadId);
            });


            watch.Stop();
            Console.WriteLine("耗时:{0}秒", watch.Elapsed.TotalSeconds);
            Console.Read();
        }
    }
}